/////////////////////////////////////////////////////////////////////////////////////////////
// Filename: Telegram.h
// (c) Dave Ottley, 2012. All rights reserved.
/////////////////////////////////////////////////////////////////////////////////////////////
#ifndef TELEGRAM_H
#define TELEGRAM_H

///////////////////////////
//		INCLUDES
///////////////////////////
#include <stdint.h>
#include <iostream>

///////////////////////////
//		MY INCLUDES
///////////////////////////


///////////////////////////
//		TELEGRAM
///////////////////////////
struct Telegram
{
	uint32_t Sender;
	uint32_t Receiver;
	uint32_t Msg;
	double DispatchTime;
	void* ExtraInfo;

	Telegram(double time, uint32_t sender, uint32_t receiver, uint32_t msg, void* info = NULL) :
		DispatchTime(time), 
		Sender(sender),
		Receiver(receiver),
		Msg(msg),
		ExtraInfo(info)
	{ }

};

inline std::ostream& operator<<(std::ostream& os, const Telegram& t)
{
	os	<< "time: " << t.DispatchTime << "  Sender: " << t.Sender
		<< "  Receiver: " << t.Receiver << "  Msg: " << t.Msg;

	return os;
}

template <class T>
inline T DereferenceToType(void* p) { return *(T*) (p); }

#endif TELEGRAM_H